import axios from 'axios';
import {adminApiPath} from "./adminApiPath";

const baseUrl = adminApiPath.admin.article;

export const getArticleDetail = async (articleId: number) => {
    const res = await axios.post(baseUrl.detail, {articleId});
    return res.data;
};

export const publishArticle = async (data: any) => {
    const res = await axios.post(baseUrl.publish, data);
    return res.data;
};

export const getArticlePageList = async (data: any) => {
    const res = await axios.post(baseUrl.list, data);
    return res.data;
};

export const deleteArticle = async (articleId: any) => {
    const res = await axios.post(baseUrl.delete, {articleId});
    return res.data;
};

export const updateArticle = async (data: any) => {
    const res = await axios.post(baseUrl.update, data);
    return res.data;
};
